home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 051-075 / disk_075 / comm / globals.h < prev    next >
C/C++ Source or Header  |  1992-05-06  |  7KB  |  202 lines

  1. /************************************************************************
  2. *    Comm -- The Communicator for the AMIGA
  3. *
  4. *  A terminal program with ascii send and capture.
  5. *  XMODEM send and receive using checksum and CRC capability
  6. *  Windowed XMODEM receive ability
  7. *
  8. ************************************************************************/
  9.  
  10. /*  compiler directives to fetch the necessary header files */
  11.  
  12. #include <libraries/dosextens.h>
  13.  
  14. #if   (COMM | MENUS | UTIL | CLOCK)
  15. #include <libraries/dos.h>
  16. #include <intuition/intuition.h>
  17. #include <exec/exec.h>
  18. #include <graphics/gfxbase.h>
  19. #include <graphics/regions.h>
  20. #include <graphics/copper.h>
  21. #include <graphics/gels.h>
  22. #include <devices/keymap.h>
  23. #include <hardware/blit.h>
  24. #endif
  25.  
  26. #if   (COMM | TIMER | PHONE | SERIALIO | CLOCK)
  27. #include <exec/devices.h>
  28. #include <exec/memory.h>
  29. #include <devices/timer.h>
  30. #endif
  31.  
  32. #if   (SERIALIO | UTIL)
  33. #include <intuition/intuition.h>
  34. #include <devices/serial.h>
  35. #endif
  36.  
  37. #include <stdio.h>
  38. #include <ctype.h>
  39. #include "defines.h"
  40.  
  41. extern struct setup {
  42.    UBYTE  version[41];
  43.    UBYTE  date[12];
  44.    UBYTE  def_dir[41];
  45.    UBYTE  DefDir[41];
  46.    USHORT new_colors[4];
  47.    UBYTE  cap_name[41];
  48.    ULONG  priority;
  49.    UBYTE  prefbaud;
  50.    ULONG  titlebar;
  51.    ULONG  interlace;
  52.    int    numbuffs;
  53.    int    period;
  54.    int    volume;
  55.    int    cycles;
  56.    int    length;
  57.    int    keyload;
  58. } install;
  59.  
  60.  
  61.  
  62. #if   (COMM | PHONE | MENUS)
  63. /*
  64.    defines required for phone library
  65.      library entry looks like this:
  66. name              number           baud    comment
  67. plink             652-0800         1200    accessed through tymnet
  68. >                 555-1212,,,12345         MCI gateway and account number
  69.  
  70. */
  71.  
  72. extern struct dir_entry {               /* phone directory entry */
  73.                     char name[ NAMESIZE+1 ];
  74.                     char number[ NBRSIZE+1 ];
  75.                     char baud[ BAUDSIZE+1 ];
  76.                     char comment[ COMTSIZE+1 ];
  77.                  } pdir[ MAXPHONE ] ;
  78.  
  79. extern UBYTE version[], date[];
  80. extern UBYTE alt_serv[ NBRSIZE+1 ];/* alternate long distance service # */
  81. extern UBYTE phl_empty[];
  82. extern UBYTE phonedir[];
  83. extern int   altservflg;
  84. #endif
  85.  
  86. extern UBYTE sbuff[],           /* sprintf work buffer */
  87.              buffer[],          /* ASCII capture buffer */
  88.              xbuffer[],         /* XMODEM buffer */
  89.              def_dir[],         /* default directory for file xfers */
  90.              *diskbuff;         /* XMODEM receive buffer */
  91. extern int   numbufs;           /* number of sectors allocated */
  92. extern unsigned
  93.     fd,                  /* XMODEM file being sent/received */
  94.     prt,                 /* printer device */
  95.     sector,              /* sector being sent/received */
  96.     baud,                /* current baud rate */
  97.     cancel,              /* TRUE if CAN received and abort_flag is TRUE */
  98.     abort,               /* TRUE if user aborts XMODEM xfer with ESC */
  99.     timeout,             /* TRUE if timeout during character receive */
  100.     chopflg,             /* TRUE if we CHOP files */
  101.     xonflg,              /* TRUE if driver does XON/XOFF */
  102.     echoflg;             /* TRUE to echo chars to sender */
  103.  
  104. extern USHORT printon;   /* TRUE if printer is ON */
  105. extern USHORT capton;    /* TRUE if capture buffer is open */
  106. extern USHORT crcflag;   /* TRUE if crc mode, FALSE for checksum */
  107.                          /* can be changed in send mode by remote receiver */
  108. extern USHORT xfrmode;   /* same as crcflag, except only under user control */
  109. extern USHORT crc;       /* 16 bit crc value */
  110. extern UBYTE  checksum;
  111. extern int viewflg;      /* TRUE if XMODEM transfers are viewed on screen */
  112. extern int close_window; /* TRUE if we have to close the split window */
  113. extern int debug;        /* general debug flag */
  114. extern int asciiflg;     /* TRUE to add CR/LF pairs to XMODEM send */
  115. extern short dcd;          /* state of modem Carrier Detect */
  116. extern short wxflag;
  117. extern short halfduplex;
  118. extern short dos_version;
  119.  
  120. extern UBYTE *keymacro[];
  121. extern UBYTE commkeys[];
  122. extern UBYTE *capt_status;
  123.  
  124. extern int    split_screen;         /* TRUE if 2 screens, FALSE if 1 */
  125. #if   (COMM | MENUS | UTIL | SERIALIO)
  126. extern struct Window       *tx_window;
  127. #endif
  128.  
  129. #if   (COMM | MENUS | UTIL | CLOCK)
  130. /*   Intuition always wants to see these declarations */
  131. extern struct IntuitionBase *IntuitionBase;
  132. extern struct GfxBase *GfxBase;
  133.  
  134. extern struct Screen       *commscreen;
  135. extern struct NewScreen    CommScreen;
  136. extern struct Window       *rx_window;     /* ptr to applications window */
  137. extern struct Window       *req_window;
  138. extern struct Window       *vw_window;
  139. extern struct Window       *stat_window;
  140. extern struct Window       *st_window;
  141.  
  142. extern struct Gadget  rx_window_close, rx_window_front, rx_window_back;
  143. extern struct Gadget  tx_window_close, tx_window_front, tx_window_back;
  144.  
  145. extern struct IntuiMessage *NewMessage;    /* msg structure for GetMsg() */
  146.  
  147. /* my window structure */
  148. extern struct NewWindow TXWindow, RXWindow, VWindow, STWindow, RQWindow;
  149. #endif
  150.  
  151. #if   (COMM | SERIALIO | UTIL | GFILE)
  152. /* declarations for the serial stuff */
  153. extern struct IOExtSer *Read_Request, *Write_Request, *Echo_Request;
  154.  
  155. extern UBYTE  rs_in[];
  156. extern UBYTE  rs_out[];
  157. extern UBYTE  rs_echo[];
  158.  
  159. /* declarations for console device */
  160.  
  161. extern struct MsgPort  *CreatePort();
  162. extern struct IOStdReq *CreateStdIO();
  163.  
  164. extern struct IOStdReq *tx_con,    *rx_con,    *st_con,    *vw_con;
  165. extern struct MsgPort  *tx_con_mp, *rx_con_mp, *st_con_mp, *vw_con_mp;
  166.  
  167. #endif
  168.  
  169. #if   (COMM | PHONE | SERIALIO | TIMER)
  170. /* Timer device allocation */
  171. extern struct timerequest TimerIO;
  172. extern struct MsgPort     TimerMsgPort;
  173. #endif
  174.  
  175.  
  176. #if (COMM | UTIL)
  177. extern struct IntuiText  Reqtext, Entertxt, oktext;
  178. extern struct StringInfo string, Dirstr;
  179. extern struct Gadget     Strgadget, OKgadget, Dirgadget, Cancelgadget;
  180. extern struct Requester  Req;
  181. extern struct MenuItem   PhoneItem[MAXPHONE+2];
  182. extern struct IntuiText  PhoneText[MAXPHONE+2];
  183.  
  184. extern struct MenuItem  FileItems[], SysItems[], ModeItems[], SerialIems[],
  185.                         PhoneItems[], DebugItems[], PlibItems[];
  186. extern struct IntuiText FileText[], SysText[], ModeText[], SerialText[],
  187.                         PhoneText[], DebugText[], EolText[], BaudText[],
  188.                         ParityText[], LengthText[], StopText[],
  189.                         DuplexText[], AltFileText[];
  190.  
  191. extern struct Menu menu[];
  192.  
  193. extern struct Image knob;
  194. extern struct PropInfo propinfo;
  195. extern struct Gadget  delay_prop;
  196. extern struct Process *this_process;
  197.  
  198. extern struct NewWindow STwindow;
  199. #endif
  200.  
  201.  
  202.